#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from tkinter import *
import random
root = Tk()

cv=Canvas(root, bg='yellow')
a = b =10
w = 50
h = 110
c = 'black'
rect=cv.create_rectangle(10,10,50,110,width=3,outline=c)

cv.pack()

def draw():
    global rect,a,b,w,h,c
    cv.delete(rect)
    a = random.randint(0,100)
    b = random.randint(0,100)
    w = random.randint(50,300)
    h = random.randint(50,300)
    c = random.choice(['red', 'blue', 'green', 'black', 'cyan'])
    rect = cv.create_rectangle(a,b,w,h,width=3,outline=c)

bt = Button(root, text='Draw', command=draw)
bt.pack()

def move():
    global rect,a,b,w,h,c
    cv.delete(rect)
    a += 1
    b += 1
    w+=1;h+=1
    rect = cv.create_rectangle(a,b,w,h,width=3,outline=c)

bt = Button(root, text='Move', command=move)
bt.pack()

root.mainloop()